Technote TE 22 | April 1986 |
The following is an example of how to eliminate the height table from a font:
IF (BitAnd(hStrike^^.fontTyp,$1)=1) THEN BEGIN {We have a height table} {Truncate the height table} SetHandleSize(Handle(hStrike),GetHandleSize(Handle(hStrike)- (2*(hStrike^^.lastChar-hStrike^^.firstChar)+3))); {We no longer have a height table so set the flag to indicate that} hStrike^^.format := BitAnd(hStrike^^.fontType,$FFFFFFFE); END;In MPW C:
if ((**hStrike).fontType & 0x1 ==1) { /*We have a height table*/ /*Truncate the height table*/ SetHandleSize((Handle)hStrike,GetHandleSize((Handle)hStrike)- (2*((**hStrike).lastChar-(**hStrike).firstChar)+3)); /*We no longer have a height table so set the flag to indicate that*/ (**hStrike).fontType = (**hStrike).fontType & 0xFFFFFFFE; }
where hStrike is a handle to the `FONT' or `NFNT' resource (handle to a FontRec).
Note: After the height table has been eliminated, the modified font
should be saved to disk (with ChangedResource and
WriteResource) and purged from memory (using
ReleaseResource). This is an important step, because the Font Manager
does not expect other code to go behind its back removing height tables that it
has calculated.
Further Reference:
Main | Page One | What's New | Apple Computer, Inc. | Find It | Contact Us | Help